package hn.cch.security.repository;

import hn.cch.security.entity.Department;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;



/**
 * @author CCH
 * @version 2018.07.02
 */
@Repository
public interface DepartmentRepository extends JpaRepository<Department, Long> {

    @Query("select d from Department d where d.name like :name")
    Page<Department> findPageByName(@Param("name") String name, Pageable pageable);
}
